//
//  ViewController.m
//  UI05_homework_OA
//
//  Created by aaaaaa on 16/6/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "CustomUIView.h"
#import "CustomUILable.h"

@interface ViewController ()<CustomUILableDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createCustomUIView];
    [self createCustomUILable];
}

- (void)createCustomUIView {
    CustomUIView *custom = [[CustomUIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    custom.backgroundColor = [UIColor redColor];
    [self.view addSubview:custom];
    [custom release];
}

- (void)createCustomUILable{
    CustomUILable *custom = [[CustomUILable alloc] initWithFrame:CGRectMake(100, 300, 100, 100)];
    custom.backgroundColor = [UIColor purpleColor];
    custom.text = @"这是一个按钮";
    custom.userInteractionEnabled = YES;
    [self.view addSubview:custom];
    [custom release];
    custom.delegate = self;
}

- (void)printInfo{
    NSLog(@"按钮被点击");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
